package design.patterns.behavioral.mediator.v2;

/**
 * @author gjx
 * @version v1.0
 * @Description
 * @date 2019/4/11 8:49
 */
public class User {
    private String name;
    private ChatRoom chatRoom;

    public User(String name, ChatRoom chatRoom) {
        this.name = name;
        this.chatRoom = chatRoom;
    }

    public User(String name) {
        this.name = name;
    }

    public void sendMsg(String message){
        chatRoom.sendMsg(this,message);
    }

    public String getName() {
        return name;
    }
}
